package day12.Exer;

import java.util.Scanner;

public class Thread1 extends Thread {
    public void run() {
        try {
            sleep(40000);
            System.exit(1);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        Thread a = new Thread1();
        a.start();
        Scanner in = new Scanner(System.in);
        while (true) {
            System.out.println("请输入账号");
            String id = in.next();
            System.out.println("请输入密码");
            String pswd = in.next();
            if ((id.equals("admin")) && (pswd.equals("admin"))) {
                System.out.println("Welcom!");
                System.exit(1);
            } else {
                System.out.println("输入错误，请重新输入");
            }
        }
    }
}
